package com.wjk.kylin.mall.member.beanmapper;

import com.wjk.kylin.mall.common.core.bo.member.MemberUserNameBO;
import com.wjk.kylin.mall.member.bo.MemberBO;
import com.wjk.kylin.mall.member.dto.MemberInDTO;
import com.wjk.kylin.mall.member.entity.MemberEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @Author: wangjinkui
 * @Date: 2021/5/28
 * @Description : 会员信息
 */
@Mapper
public interface MemberEntityMapper {
    MemberEntityMapper INSTANCE = Mappers.getMapper(MemberEntityMapper.class);

    /**
     * entity to bo
     * @param entity
     * @return
     */
    MemberBO entity2BO(MemberEntity entity);

    /**
     * entity to bo
     * @param entity
     * @return
     */
    MemberUserNameBO entity2UserNameBO(MemberEntity entity);
    /**
     * dto to entity
     * @param dto
     * @return
     */
    MemberEntity dto2Entity(MemberInDTO dto);
}
